package com.cloudalibabaconsumer8084.controller;

import com.cloudalibabacomment8001.entity.JsonResult;
import com.cloudalibabaconsumer8084.Service.FeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2024/11/27 20:07
 * @Version 1.0
 */
@RestController
@RequestMapping("/feign")
public class FeignController {


    @Resource
    private FeignService feignService;

    @GetMapping("/test/{id}")
    public JsonResult<String> test(@PathVariable("id") Long id){

        if (id>3){
            throw new RuntimeException("id不能大于3");
        }

        return feignService.msbSql(id);
    }
}
